* ============================================================================ *
* PROJECT:		MAKING COUNTRIES SMALL: THE NATIONALIZATION OF DISTRICTS
* JOURNAL: 		Political Science Research Methods
* OBJECTIVE		Replicating resuls
* AUTHOR: 		Ignacio Lago
* DATE:			2022-12-14
* ============================================================================ *

*Load dataset
use "constituency_level.dta"


*Figures 1 and 2

lowess ENP_cst yr if ENP_cst<3, name(a1)
gen south=dummies
recode south 20=1 25=1 27=1 5=1 23=1 18=1 10=1 3=1 14=1 29=1 9=1  *=0
lowess ENP_cst yr if ENP_cst<3 & south==0, name(a2)
lowess ENP_nat yr, name(a3)
graph combine a3 a1 a2
gen timezones=dummies
recode timezones 13=5 4=5 27=5 5=5 17=5 15=5 21=5 6=5 24=5 26=5  1=5 7=5 8=5 10=5 16=5 2=5 11=5 3=5 14=5 12=5 9=5 50=5 20=6 25=6 19=6 28=6 34=6 23=6 32=6 18=6 36=6 42=6 43=6 45=6 29=6 30=6 22=6 47=7 37=7 38=7 46=7 44=7 40=7 31=8 41=8 35=8 33=8 39=8 51=5 *=.
lowess ENP_cst yr if ENP_cst<3, by(timezones)

*Tables A1 and A2 and Figure 3 

reg ENP_cst c.logdis   vv1million   popmillion i.dummies if yr<1850&dummies!=48&dummies!=49, cluster(dummies)
estimates store c
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr<1875&dummies!=48&dummies!=49, cluster(dummies)
estimates store d
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr<1900&dummies!=48&dummies!=49, cluster(dummies)
estimates store e
reg ENP_cst c.logdis   vv1million   popmillion i.dummies if yr<1925&dummies!=48&dummies!=49, cluster(dummies)
estimates store f
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr<1950&dummies!=48&dummies!=49, cluster(dummies)
estimates store h
reg ENP_cst c.logdis   vv1million   popmillion i.dummies if yr<1975&dummies!=48&dummies!=49, cluster(dummies)
estimates store i
reg ENP_cst c.logdis   vv1million   popmillion i.dummies if yr<2000&dummies!=48&dummies!=49, cluster(dummies)
estimates store j
reg ENP_cst c.logdis   vv1million   popmillion i.dummies if yr<2020&dummies!=48&dummies!=49, cluster(dummies)
estimates store k
coefplot c d e f h i j k  , keep ( logdist) yline(0) xlabel(0.61(0.11)1.38, grid) leg(off) ciopts(lcolor(ebblue)) mcolor(ebblue) vert name(c1)
reg ENP_cst c.logdis   popmillion vv1million  i.dummies if south==0&yr<1850&dummies!=48&dummies!=49, cluster(dummies)
estimates store c
reg ENP_cst c.logdis    popmillion vv1million   i.dummies if south==0&yr<1875&dummies!=48&dummies!=49, cluster(dummies)
estimates store d
reg ENP_cst c.logdis   popmillion vv1million   i.dummies if south==0&yr<1900&dummies!=48&dummies!=49, cluster(dummies)
estimates store e
reg ENP_cst c.logdis    popmillion vv1million   i.dummies if south==0&yr<1925&dummies!=48&dummies!=49, cluster(dummies)
estimates store f
reg ENP_cst c.logdis   popmillion vv1million   i.dummies if south==0&yr<1950&dummies!=48&dummies!=49, cluster(dummies)
estimates store h
reg ENP_cst c.logdis   popmillion vv1million   i.dummies if south==0&yr<1975&dummies!=48&dummies!=49, cluster(dummies)
estimates store i
reg ENP_cst c.logdis    popmillion vv1million   i.dummies if south==0&yr<2000&dummies!=48&dummies!=49, cluster(dummies)
estimates store j
reg ENP_cst c.logdis   popmillion vv1million   i.dummies if south==0&yr<2020&dummies!=48&dummies!=49, cluster(dummies)
estimates store k
coefplot c d e f h i j k  , keep ( logdist) yline(0) xlabel(0.61(0.11)1.38, grid) leg(off) ciopts(lcolor(ebblue)) mcolor(ebblue) vert name(c2)
graph combine c1 c2

*Tables A3 and A4 and Figure 4 

reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr>1849&yr<1875&dummies<32, cluster(dummies)
estimates store d
reg ENP_cst c.logdis   vv1million  popmillion  i.dummies if yr>1849&yr<1900&dummies<32, cluster(dummies)
estimates store e
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr>1849&yr<1925&dummies<32, cluster(dummies)
estimates store f
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr>1849&yr<1950&dummies<32, cluster(dummies)
estimates store h
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr>1849&yr<1975&dummies<32, cluster(dummies)
estimates store i
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr>1849&yr<2000&dummies<32, cluster(dummies)
estimates store j
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if yr>1849&yr<2020&dummies<32, cluster(dummies)
estimates store k
coefplot  d e f h i j k  , keep ( logdist) yline(0) xlabel(0.625(0.125)1.375, grid) leg(off) ciopts(lcolor(ebblue)) mcolor(ebblue) vert name(c3)
reg ENP_cst c.logdis   vv1million   popmillion i.dummies if south==0&yr>1849&yr<1875&dummies<32, cluster(dummies)
estimates store d
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if south==0&yr>1849&yr<1900&dummies<32, cluster(dummies)
estimates store e
reg ENP_cst c.logdis   vv1million  popmillion   i.dummies if south==0&yr>1849&yr<1925&dummies<32, cluster(dummies)
estimates store f
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if south==0&yr>1849&yr<1950&dummies<32, cluster(dummies)
estimates store h
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if south==0&yr>1849&yr<1975&dummies<32, cluster(dummies)
estimates store i
reg ENP_cst c.logdis   vv1million    popmillion i.dummies if south==0&yr>1849&yr<2000&dummies<32, cluster(dummies)
estimates store j
reg ENP_cst c.logdis   vv1million   popmillion i.dummies if south==0&yr>1849&yr<2020&dummies<32, cluster(dummies)
estimates store k
coefplot  d e f h i j k  , keep ( logdist) yline(0) xlabel(0.625(0.125)1.375, grid) leg(off) ciopts(lcolor(ebblue)) mcolor(ebblue) vert name(c4)
graph combine c3 c4

*Table 2
bysort timezones: reg ENP_cst c.yr vv1million popmillion  i.dummies if timezones<9, cluster(dummies)

*Table A5
bysort timezones: reg ENP_cst c.yr vv1million popmillion  i.dummies if south==0&timezones<9, cluster(dummies)
